package com.yanqu.road.entity.activity.jiuzhou.game;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.Map;

/**
 * 门客战斗数据
 */
public class CrossJiuZhouGamePatronsData {

    private int patronsId;

    /**
     * 基础战力
     */
    private BigInteger baseAbility = BigInteger.ZERO;

    /**
     * 加成百分比
     */
    private long addRadio;

    /**
     * 加成固定值
     */
    private BigInteger addValue = BigInteger.ZERO;

    /**
     * 权重加成百分比
     */
    private long addWeightRadio;

    /**
     * 出战次数
     */
    private int battleTimes;

    public CrossJiuZhouGamePatronsData clone() {
        CrossJiuZhouGamePatronsData patronsData = new CrossJiuZhouGamePatronsData();
        patronsData.setPatronsId(this.patronsId);
        patronsData.setBaseAbility(new BigInteger(this.baseAbility.toString()));
        patronsData.setAddRadio(this.addRadio);
        patronsData.setAddValue(new BigInteger(this.addValue.toString()));
        patronsData.setBattleTimes(this.battleTimes);
        return patronsData;
    }

    public CrossJiuZhouGamePatronsData() {

    }

    public int getPatronsId() {
        return patronsId;
    }

    public void setPatronsId(int patronsId) {
        this.patronsId = patronsId;
    }

    public BigInteger getAbility() {
        return BigInteger.valueOf(Math.max(0, BigDecimal.valueOf(baseAbility.longValue())
                .multiply(BigDecimal.valueOf(100 + addRadio)).divide(BigDecimal.valueOf(100), 0, RoundingMode.UP)
                .add(BigDecimal.valueOf(addValue.longValue()))
                .longValue()));
    }

    public BigInteger getBaseAbility() {
        return baseAbility;
    }

    public void setBaseAbility(BigInteger baseAbility) {
        this.baseAbility = baseAbility;
    }

    public long getAddRadio() {
        return addRadio;
    }

    public void setAddRadio(long addRadio) {
        this.addRadio = addRadio;
    }

    public BigInteger getAddValue() {
        return addValue;
    }

    public void setAddValue(BigInteger addValue) {
        this.addValue = addValue;
    }

    public long getAddWeightRadio() {
        return addWeightRadio;
    }

    public void setAddWeightRadio(long addWeightRadio) {
        this.addWeightRadio = addWeightRadio;
    }

    public int getBattleTimes() {
        return battleTimes;
    }

    public void setBattleTimes(int battleTimes) {
        this.battleTimes = battleTimes;
    }
}
